<template>
    <div class="common-layout">
        <el-container>
            <el-header>Header</el-header>
            <el-main>
                <el-table :data="tableData" style="width: 100%" height="250">
                    <el-table-column type="index" label="序号" width="55" />
                    <el-table-column prop="goods_Name" label="商品名称" />
                    <el-table-column prop="binL_Code" label="库位" />
                    <el-table-column prop="goodsInWL_OutNums" label="出库数量" />
                    <el-table-column label="操作">
                        <template #default="scope">
                            <el-button type="danger">删除</el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </el-main>
        </el-container>
    </div>
</template>
<script setup lang="ts">
import { ref, reactive, onMounted, watch } from 'vue'
import axiosHelper from '@/components/AxiosRequest/axiosHelper'

const pageData = reactive(
    {
        pageIndex: 1,
        pageSize: 10,
        totalCount: 0,
        totalPage: 0
    }
)

const tableData = ref([])
function getData() {
    axiosHelper.readAxios.get('api/Outbound/QueryOutBound',
        {
            params: {
                pageIndex: pageData.pageIndex,
                pageSize: pageData.pageSize
            }
        }
    )
        .then(res => {
            console.log(res)
            tableData.value = res.data.data.data
            pageData.totalCount = res.data.data.totalCount
            pageData.totalPage = res.data.data.totalPage
        })
}

//钩子函数
onMounted(() => {
    getData()
})
</script>